//POJ 1269
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <cassert>

using namespace std;

const double eps=1e-7;
inline int dcmp(const double &d){if(fabs(d)<eps) return 0;else return d>0?1:-1;}
struct Point{
    double x,y;
    Point(double x=0,double y=0):x(x),y(y){}
    const Point operator + (const Point &p) const{return Point(x+p.x,y+p.y);}
    const Point operator - (const Point &p) const{return Point(x-p.x,y-p.y);}
    const Point operator / (const double &d) const{return Point(x/d,y/d);}
    friend const Point operator * (const double &d,const Point &p){return Point(d*p.x,d*p.y);}
};
struct Line{
    Point u,v;
    double k;
    Line(const Point &u=Point(),const Point &v=Point()):u(u),v(v){}
    void getK(){k=atan2(v.y-u.y,v.x-u.x);}
};
double cross(const Point &p,const Point &q){
    return p.x*q.y-p.y*q.x;
}
double area(const Point &p,const Point &q,const Point &r){
    return cross(q-p,r-p);
}
Point inter(const Line &m,const Line &n){
    double k1,k2;
    k1=area(m.u,n.u,n.v);
    k2=area(n.u,m.v,n.v);
    return (k1*m.v+k2*m.u)/(k1+k2);
}

int main(){
    Line m,n;
    int N;

    scanf("%d",&N);
    puts("INTERSECTING LINES OUTPUT");
    while(N--){
        scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&m.u.x,&m.u.y,&m.v.x,&m.v.y,&n.u.x,&n.u.y,&n.v.x,&n.v.y);
        m.getK();n.getK();
        if(dcmp(cross(m.u-m.v,n.u-n.v))){
            Point p=inter(m,n);
            printf("POINT %.2f %.2f\n",p.x,p.y);
        }else{
            if(dcmp(cross(m.u-m.v,m.u-n.u))) printf("NONE\n");
            else printf("LINE\n");
        }
    }
    puts("END OF OUTPUT");
    return 0;
}

